
RM := rm -rf

CPP_SRCS :=  $(wildcard ./*.cpp)
OBJS := $(patsubst %.cpp, %.o, $(CPP_SRCS))
CPP_DEPS := $(patsubst %.cpp, %.d, $(CPP_SRCS))
LIBS := -lzcvbase
INCLUDE_PATH := -I/usr/java/jdk1.8.0_111/include \
                -I/usr/java/jdk1.8.0_111/include/linux \
                -I/root/oscompress/build/zcvZip
LIBS_PATH := -L.

# All Target
all: libzcvInterface.so

%.o : %.cpp 
	@echo 'Building file: $<'
	@echo 'Invoking: GCC C++ Compiler'
	g++ $(INCLUDE_PATH) -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '


# Tool invocations
libzcvInterface.so: $(OBJS) 
	@echo 'Building target: $@'
	@echo 'Invoking: GCC C++ Linker'
	g++ $(LIBS_PATH) -shared -o "libzcvInterface.so" $(OBJS) $(LIBS)
	@echo 'Finished building target: $@'
	@echo ' '

clean:
	-$(RM) $(OBJS) $(CPP_DEPS) libzcvInterface.so
	-@echo ' '

.PHONY: all clean

